package fun.abbas.demo240621;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import java.util.Arrays;

import fun.abbas.demo240621.bean.WeatherVo;
import fun.abbas.demo240621.view.BP3Entity;
import fun.abbas.demo240621.view.BPView3;
import fun.abbas.demo240621.view.WeatherLineView;
import fun.abbas.demo240621.view.WeightView2;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        WeightView2 viewById = findViewById(R.id.weightView2);
        viewById.setData(Arrays.asList(
                45,46,47,48,49,44,43,42,41,40
        ));

//        BPView3 viewById = findViewById(R.id.BPView2);
//        viewById.setData(Arrays.asList(
//                new BP3Entity(88,94),
//                new BP3Entity(87,92),
//                new BP3Entity(84,95),
//                new BP3Entity(89,99),
//                new BP3Entity(80,92),
//                new BP3Entity(87,98),
//                new BP3Entity(80,99)
//        ));
//        WeatherLineView weatherLineView = findViewById(R.id.weatherLineView);
//
//        Button button = findViewById(R.id.button);
//        button.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                weatherLineView.setTempList(Arrays.asList(
//                        new WeatherVo(28, 14),
//                        new WeatherVo(29, 18),
//                        new WeatherVo(25, 17),
//                        new WeatherVo(24, 18),
//                        new WeatherVo(26, 19),
//                        new WeatherVo(29, 18)
//                ));
//            }
//        });

    }
}